<template>
  <a-modal
    title="策略任务"
    :width="1500"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :destroyOnClose="true"
    :footer="null"
    @cancel="handleCancel"
    >
    <a-spin :spinning="confirmLoading">
      <a-row  type="flex" justify="center" align="top">
        <a-col :span="12">
            <task-index :policyId="record.id" :curTaskId="curTaskId" @selected="handleSelectTask"/>
        </a-col>
        <a-col :span="12">
            <task-step ref="taskStepForm" :taskId="curTaskId"/>
        </a-col>
      </a-row>
    </a-spin>
  </a-modal>
</template>

<script>
import taskIndex from '../PolicyTask/index.vue'
import taskStep from '../PolicyStep/index.vue'
export default {
  components:{
    taskIndex,
    taskStep
  },
  data() {
    return {
      record: {},
      securityLevelData: [],
      visible: false,
      confirmLoading: false,
      curTaskId:null
    }
  },
  methods: {
    // 初始化方法
    edit(record) {
      this.visible = true
      this.record = record
      this.curTaskId=null
    },
    handleCancel() {
      this.visible = false
    },
    handleSelectTask(val){
        this.curTaskId=val;
        this.$refs.taskStepForm.refresh(val);
    },
  },
}
</script>
